home *** CD-ROM | disk | FTP | other *** search
- Path: pubxfer.news.psi.net!usenet
- From: bweiss@somehost.somedomain (Bill Weiss)
- Newsgroups: comp.lang.c++
- Subject: Re: What's wrong with this program under Borland C++ 4.52?
- Date: 7 Mar 1996 14:40:50 GMT
- Organization: ASSET InterTech, Inc.
- Message-ID: <4hmshi$nvj@client1.news.psi.net>
- References: <96063.152225IO92118@MAINE.MAINE.EDU>
- NNTP-Posting-Host: host48.asset-intertech.com
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=US-ASCII
- X-Newsreader: WinVN 0.99.7
-
- In article <96063.152225IO92118@MAINE.MAINE.EDU>, IO92118@MAINE.MAINE.EDU
- says...
- >
- >I typed in a first sample program for window programming.
- >
- >I did everything as book says, but it doesn't work.
- >
- >What's wrong with it?
- >
- >I check several examples in BC45 for OWL.
- >
- >It looks like I should use #include <owl/applicat.h>
- >#include <owl/framewin.h>
- >
- >I changed HANDLE with HINSTANCE, it doesn't work.
- >I tried almost all the combination to do anything I can.
- >If you happen the problems, could you mail to me?
- >Thank you very much for your help!!!
- >
- >han
- >
- >The following is program:
- >//****************************************************************************
- >#include <owl.h>
- >
- >class TSampApp : public TApplication {
- > public:
- > TSampApp(LPSTR AName, HANDLE hInstance, HANDLE hPrevInstance, LPSTR
- >lpCmdLine, int nCmdShow) : TApplication(AName, hInstance, hPrevInstance,
- >lpCmdLine,
- >nCmdShow) {};
- > virtual void InitMainWindow();
- >};
- >
- >void TSampApp::InitMainWindow()
- >{
- >
- > MainWindow = new TWindow(NULL, Name);
- >
- >}
- >
- >int PASCAL WinMain(HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpCmdLine,
- >int nCmdShow)
- >{
- > TSampApp SampApp ("SAMPLE WINDOW", hInstance, hPrevInstance,lpCmdLine,
- >nCmdShow);
- >
- > SampApp.Run();
- >
- > return SampApp.Status;
- >
- >}
- >
-
- When build OWL programs I include the header files you mention above. Also I
- believe the main window needs to be of type TFrameWindow not TWindow. I also
- think that your supposed to use OwlMain instead of WinMain. Other than the
- things I mentioned it looks OK.
-
- Bill
-
-